package com.etc.RCCPU006.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.etc.RCCPU006.dao.Consult_mstMapper;
import com.etc.RCCPU006.pojo.Consult_mst;
import com.etc.RCCPU006.service.ConsultService;
import com.etc.common.Code;
import com.etc.common.ServiceException;

@Service
public class ConsultServiceImpl implements ConsultService{
	
	@Autowired
	Consult_mstMapper mapper;

	
	@Override
	@Transactional(rollbackFor=Exception.class)
	public void insertConsult(Consult_mst c) {
		 int i = mapper.insert(c);
	        if (i != 1) {
	            try {
					throw new ServiceException(Code.ERROR);
				} catch (ServiceException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	        }

	}



	@Override
	public List<Map> selectProductInfo() {
		return mapper.selectProductInfo();
	}

}
